import java.util.Arrays;

public class TestDemo {
    public static void main(String[] args) {
        int arr[]=new int[]{1,5,40,3,20,78,3};
        for (int i = 1; i < arr.length; i++) {
            for (int j = 0; j < arr.length-i; j++) {
                if (arr[j]<arr[j+1]){
                    int temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }

        }
        System.out.println(Arrays.toString(arr));
    }
}
